<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        //准备原数组
        var arr1 = [33, 44, 55, 66, [99, 22], 111];
        //准备一个结果数组
        var result = [];
        //遍历原数组
        for (var i = 0; i < arr1.length; i++) {
            result.push(arr1[i]);
        }
        //输出结果数组
        console.log(result);
        // 测试是否实现了克隆 ，就是说本质上是内存中的不同数组了
        console.log(arr1 == result); // false
        //测试这样的克隆是浅克隆“藕断丝连”
        arr1[4].push(100);
        console.log(result);
    </script>

</body>

</html>